﻿@model Orion.Models.HomeIndexViewModel
           
<script src="@Url.Content("~/Scripts/Pagination/jquery.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Pagination/jquery.pagination.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Pagination/jquery.pag.js")" type="text/javascript"></script>

@{
    ViewBag.Title = "IRIS - Fréttir";
}
     
<section id="main_content_wrapper">
    <div id="Searchresult"></div>      


@{
    var sk = 0;
    for (int m = 0; m < Model.counter; m++)
    {
    <div id="hiddenresult" style="display:none;">
        <div class="result">


        @foreach (var t in Model.NewsArticle.Skip( sk ).Take( Model.displayNewsArticle ) )
        {
            if (t.NewsArticleType.Valid == true)
            {
                DateTime temp = t.ContentDate;
                <article class="single">
                    <h1><a href="/NewsArticle/NewsArticleById/@t.ID">@t.Title</a></h1>
                    <span class="left">Höf: @t.Author</span>
                    <span class="right"> @temp.ToString("dd MMMM yyyy")</span>
                    <div class="clear"></div>
                        @if (t.Picture != "no pic")
                            {
                                <div class="shortenMeNewsFullViewImg">
                                <img  src="@t.Picture" alt="@t.Picture"  class="imgInTextLeft" />
                                @Html.Raw(t.TextBody)</div> 
                            }
                            else
                            {
                            <div class="shortenMeNewsFullView">@Html.Raw(t.TextBody)</div> 
                            }
                            
                <span class="lesaMeira"><a href= "/NewsArticle/NewsArticleById/@t.ID"> &raquo; lesa meira</a> </span>
            </article>
            }
        }
        </div>
    </div>
    sk = sk + Model.displayNewsArticle;
    }
}
<div class="clear"></div><div id="Pagination"></div>
</section>
<div class="clear"></div>